import { useDispatch, useSelector } from "react-redux"
import { dispatchType, initialStateType } from "@/libs/store"
const useRedux = () => {
    const { room } = useSelector<initialStateType, initialStateType>(state => state)
    const dispatch = useDispatch()
    const setRoom = (data) => dispatch<dispatchType>({
        type: "set_room",
        data
    })
    return {
        room,
        actions: {
            setRoom
        }
    }
}
export default useRedux